package com.yicong.ants.bean.home;

import com.cchao.simplelib.util.StringHelper;
import com.chad.library.adapter.base.entity.MultiItemEntity;

import java.util.ArrayList;
import java.util.List;

/**
 * @author cchao
 * @version 2019-07-31.
 */
public class NewsItem implements MultiItemEntity {
    /**
     * id : 50
     * title : 有毒！地沟油煎炸、双氧水浸泡……这样的凤爪你还敢吃吗？不如自己做着吃！
     * pid : 6
     * url_content : ["http://qiniu.yytxlyw.com/uploads/20181201/Frs95X28lhwLBhA1CkPIqwIpAxw6.jpg","http://qiniu.yytxlyw.com/uploads/20181201/Fmsl7nkOtVYQNR2zadm5ZmhHVKuV.jpg","http://qiniu.yytxlyw.com/uploads/20181201/Frex70CxJOvMOhzOVta9xU3p6pZ9.jpg"]
     * look_num : 20103
     * keyword : 有毒！地沟油煎炸、双氧水浸泡……这样的凤爪你还敢吃吗？不如自己做着吃！
     * weigh : 50
     * createtime : 1月以前
     * release_Identification : 1
     * user_id : 23
     * top : 1
     * is_ad : 1
     * type_name : 食品曝光
     * comment_num : 0
     * release_nickname : 管全丁
     * video_thumb :
     * url_content_type : img
     */

    private int id;
    private String title;
    private int pid;
    private int look_num;
    private String keyword;
    private int weigh;
    private String createtime;
    private String release_Identification;
    private int user_id;
    private int top;
    private int is_ad;
    private String type_name;
    private int comment_num;
    private String release_nickname;
    private String video_thumb;
    private String url_content_type;
    private List<String> url_content = new ArrayList<>();

    public NewsItem() {
    }

    @Override
    public int getItemType() {
        return url_content.size() == 1 && url_content_type.equals("img") ? 1 : 0;
    }

    public String getUrl_content_type() {
        if (StringHelper.isEmpty(url_content_type)) {
            return "img";
        }
        return url_content_type;
    }

    public int getId() {
        return this.id;
    }

    public String getTitle() {
        return this.title;
    }

    public int getPid() {
        return this.pid;
    }

    public int getLook_num() {
        return this.look_num;
    }

    public String getKeyword() {
        return this.keyword;
    }

    public int getWeigh() {
        return this.weigh;
    }

    public String getCreatetime() {
        return this.createtime;
    }

    public String getRelease_Identification() {
        return this.release_Identification;
    }

    public int getUser_id() {
        return this.user_id;
    }

    public int getTop() {
        return this.top;
    }

    public int getIs_ad() {
        return this.is_ad;
    }

    public String getType_name() {
        return this.type_name;
    }

    public int getComment_num() {
        return this.comment_num;
    }

    public String getRelease_nickname() {
        return this.release_nickname;
    }

    public String getVideo_thumb() {
        return this.video_thumb;
    }

    public List<String> getUrl_content() {
        return this.url_content;
    }

    public void setId(int id) {
        this.id = id;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public void setPid(int pid) {
        this.pid = pid;
    }

    public void setLook_num(int look_num) {
        this.look_num = look_num;
    }

    public void setKeyword(String keyword) {
        this.keyword = keyword;
    }

    public void setWeigh(int weigh) {
        this.weigh = weigh;
    }

    public void setCreatetime(String createtime) {
        this.createtime = createtime;
    }

    public void setRelease_Identification(String release_Identification) {
        this.release_Identification = release_Identification;
    }

    public void setUser_id(int user_id) {
        this.user_id = user_id;
    }

    public void setTop(int top) {
        this.top = top;
    }

    public void setIs_ad(int is_ad) {
        this.is_ad = is_ad;
    }

    public void setType_name(String type_name) {
        this.type_name = type_name;
    }

    public void setComment_num(int comment_num) {
        this.comment_num = comment_num;
    }

    public void setRelease_nickname(String release_nickname) {
        this.release_nickname = release_nickname;
    }

    public void setVideo_thumb(String video_thumb) {
        this.video_thumb = video_thumb;
    }

    public void setUrl_content_type(String url_content_type) {
        this.url_content_type = url_content_type;
    }

    public void setUrl_content(List<String> url_content) {
        this.url_content = url_content;
    }

    public boolean equals(final Object o) {
        if (o == this) return true;
        if (!(o instanceof NewsItem)) return false;
        final NewsItem other = (NewsItem) o;
        if (!other.canEqual((Object) this)) return false;
        if (this.getId() != other.getId()) return false;
        final Object this$title = this.getTitle();
        final Object other$title = other.getTitle();
        if (this$title == null ? other$title != null : !this$title.equals(other$title))
            return false;
        if (this.getPid() != other.getPid()) return false;
        if (this.getLook_num() != other.getLook_num()) return false;
        final Object this$keyword = this.getKeyword();
        final Object other$keyword = other.getKeyword();
        if (this$keyword == null ? other$keyword != null : !this$keyword.equals(other$keyword))
            return false;
        if (this.getWeigh() != other.getWeigh()) return false;
        final Object this$createtime = this.getCreatetime();
        final Object other$createtime = other.getCreatetime();
        if (this$createtime == null ? other$createtime != null : !this$createtime.equals(other$createtime))
            return false;
        final Object this$release_Identification = this.getRelease_Identification();
        final Object other$release_Identification = other.getRelease_Identification();
        if (this$release_Identification == null ? other$release_Identification != null : !this$release_Identification.equals(other$release_Identification))
            return false;
        if (this.getUser_id() != other.getUser_id()) return false;
        if (this.getTop() != other.getTop()) return false;
        if (this.getIs_ad() != other.getIs_ad()) return false;
        final Object this$type_name = this.getType_name();
        final Object other$type_name = other.getType_name();
        if (this$type_name == null ? other$type_name != null : !this$type_name.equals(other$type_name))
            return false;
        if (this.getComment_num() != other.getComment_num()) return false;
        final Object this$release_nickname = this.getRelease_nickname();
        final Object other$release_nickname = other.getRelease_nickname();
        if (this$release_nickname == null ? other$release_nickname != null : !this$release_nickname.equals(other$release_nickname))
            return false;
        final Object this$video_thumb = this.getVideo_thumb();
        final Object other$video_thumb = other.getVideo_thumb();
        if (this$video_thumb == null ? other$video_thumb != null : !this$video_thumb.equals(other$video_thumb))
            return false;
        final Object this$url_content_type = this.getUrl_content_type();
        final Object other$url_content_type = other.getUrl_content_type();
        if (this$url_content_type == null ? other$url_content_type != null : !this$url_content_type.equals(other$url_content_type))
            return false;
        final Object this$url_content = this.getUrl_content();
        final Object other$url_content = other.getUrl_content();
        if (this$url_content == null ? other$url_content != null : !this$url_content.equals(other$url_content))
            return false;
        return true;
    }

    protected boolean canEqual(final Object other) {
        return other instanceof NewsItem;
    }

    public int hashCode() {
        final int PRIME = 59;
        int result = 1;
        result = result * PRIME + this.getId();
        final Object $title = this.getTitle();
        result = result * PRIME + ($title == null ? 43 : $title.hashCode());
        result = result * PRIME + this.getPid();
        result = result * PRIME + this.getLook_num();
        final Object $keyword = this.getKeyword();
        result = result * PRIME + ($keyword == null ? 43 : $keyword.hashCode());
        result = result * PRIME + this.getWeigh();
        final Object $createtime = this.getCreatetime();
        result = result * PRIME + ($createtime == null ? 43 : $createtime.hashCode());
        final Object $release_Identification = this.getRelease_Identification();
        result = result * PRIME + ($release_Identification == null ? 43 : $release_Identification.hashCode());
        result = result * PRIME + this.getUser_id();
        result = result * PRIME + this.getTop();
        result = result * PRIME + this.getIs_ad();
        final Object $type_name = this.getType_name();
        result = result * PRIME + ($type_name == null ? 43 : $type_name.hashCode());
        result = result * PRIME + this.getComment_num();
        final Object $release_nickname = this.getRelease_nickname();
        result = result * PRIME + ($release_nickname == null ? 43 : $release_nickname.hashCode());
        final Object $video_thumb = this.getVideo_thumb();
        result = result * PRIME + ($video_thumb == null ? 43 : $video_thumb.hashCode());
        final Object $url_content_type = this.getUrl_content_type();
        result = result * PRIME + ($url_content_type == null ? 43 : $url_content_type.hashCode());
        final Object $url_content = this.getUrl_content();
        result = result * PRIME + ($url_content == null ? 43 : $url_content.hashCode());
        return result;
    }

    public String toString() {
        return "NewsItem(id=" + this.getId() + ", title=" + this.getTitle() + ", pid=" + this.getPid() + ", look_num=" + this.getLook_num() + ", keyword=" + this.getKeyword() + ", weigh=" + this.getWeigh() + ", createtime=" + this.getCreatetime() + ", release_Identification=" + this.getRelease_Identification() + ", user_id=" + this.getUser_id() + ", top=" + this.getTop() + ", is_ad=" + this.getIs_ad() + ", type_name=" + this.getType_name() + ", comment_num=" + this.getComment_num() + ", release_nickname=" + this.getRelease_nickname() + ", video_thumb=" + this.getVideo_thumb() + ", url_content_type=" + this.getUrl_content_type() + ", url_content=" + this.getUrl_content() + ")";
    }
}
